import re
import regex

regex.DEFAULT_VERSION = regex.V1
import os


class SplitHandler(object):
    def __init__(self, language='en', advice_length=200):
        self.language = language.lower()
        self.__advice_length = advice_length
        self.__is_cjk = 1 if self.language in ('zh', 'yue', 'ja') else 0
        self.__prefix = {}
        self.__isN, self.__lower, self.__alpha = '', '', ''
        self.__sentence_start = r'\p{Upper}0-9'
        self.__init_prefix()
        self.__get_sentence_start()

    def __init_prefix(self):
        path = f'moses/share/nonbreaking_prefixes/nonbreaking_prefix.{self.language}'
        if os.path.exists(path):
            with open(path, 'r', encoding='utf8') as f:
                lines = f.readlines()
                for i in lines:
                    i = i.replace('\n', '')
                    if i and not i.startswith('#'):
                        m = regex.match(r'(.*)[\s]+(\#NUMERIC_ONLY\#)', i)
                        if m:
                            self.__prefix[m.group(1)] = 2
                        else:
                            self.__prefix[i] = 1

        # region 分词脚本影响内容

        path_isN = 'assets/IsN.txt'
        if os.path.exists(path_isN):
            with open(path_isN, 'r', encoding='utf-8') as f:
                self.__isN = f.read()
        path_isAlpha = 'assets/IsAlpha.txt'
        if os.path.exists(path_isAlpha):
            with open(path_isAlpha, 'r', encoding='utf-8') as f:
                self.__alpha = f.read()
        path_isLower = 'assets/IsLower.txt'
        if os.path.exists(path_isLower):
            with open(path_isLower, 'r', encoding='utf-8') as f:
                self.__lower = f.read()

        # endregion

    def isanyalpha(self, content):
        if self.__alpha:
            return any(set(content).intersection(set(self.__alpha)))
        else:
            raise Exception("Please confirm that the file 'assets/IsAlpha.txt' exists")

    def islower(self, content):
        if self.__lower:
            return not any(set(content).difference(set(self.__alpha)))
        else:
            raise Exception("Please confirm that the file 'assets/IsLower.txt' exists")

    def __get_sentence_start(self):
        if self.language in ('hi', 'mr'):  # line130
            self.__sentence_start += r'\p{Devanagari}\p{Devanagari_Extended}'
        elif self.language in ('as', 'bn', 'mni'):  # line132
            self.__sentence_start += r'\p{Bengali}'
        elif self.language == 'gu':
            self.__sentence_start += r'\p{Gujarati}'
        elif self.language == 'kn':
            self.__sentence_start += r'\p{Kannada}'
        elif self.language == 'ml':
            self.__sentence_start += r'\p{Malayalam}'
        elif self.language == 'or':
            self.__sentence_start += r'\p{Oriya}'
        elif self.language == 'pa':
            self.__sentence_start += r'\p{Gurmukhi}'
        elif self.language == "ta":
            self.__sentence_start += r'\p{Tamil}'
        elif self.language == "te":
            self.__sentence_start += r'\p{Telugu}'
        elif self.language == "ko":
            self.__sentence_start += r'\p{Hangul}\p{Hangul_Compatibility_Jamo}\p{Hangul_Jamo}\p{Hangul_Jamo_Extended_A}\p{Hangul_Jamo_Extended_B}'

    # 源自perl 分句脚本
    def split_mose(self, content, list_item=0):
        # get self.prefix

        # Clean up spaces at head and tail of each line, as well as
        # any double-spacing.
        content = re.sub(r' +', ' ', content)
        content = re.sub(r'\n ', '\n', content)
        content = re.sub(r' \n', '\n', content)
        content = content.strip()

        # Sentences can start with upper-case, numnbers,  or Indic characters
        # get self.sentence_start

        # Non-period end of sentence markers (?!) followed by sentence starters.
        # $text =~ s/([?!\x{0964}\x{0965}]) +([\'\"\(\[\¿\¡\p{IsPi}]*[$sentence_start])/$1\n$2/g;
        pattern_str = r'([?!\u0964\u0965]) +([\'\"\(\[¿¡\p{Pi}]*' \
                      + f'[{self.__sentence_start}])'
        content = regex.subf(pattern_str, '{1}\n{2}', content)

        # Multi-dots followed by sentence starters.
        # $text =~ s/(\.[\.]+) +([\'\"\(\[\¿\¡\p{IsPi}]*[$sentence_start])/$1\n$2/g;
        # pattern_str = r'(\.[\.]+) +([\'\"\(\[\¿\¡\p{Pi}]*' + f'[{self.__sentence_start}])'
        pattern_str = r'(\.[.]+) +([\'\"\(\[¿¡\p{Pi}]*' \
                      + f'[{self.__sentence_start}])'
        content = regex.subf(pattern_str, '{1}\n{2}', content)

        # Add breaks for sentences that end with some sort of punctuation
        # inside a quote or parenthetical and are followed by a possible
        # sentence starter punctuation and upper case.
        # $text =~ s/([?!\.\x{0964}\x{0965}][\ ]*[\x{300d}\x{300f}\'\"\)\]\p{IsPf}]+) +([\'\"\(\[\¿\¡\p{IsPi}]*[\ ]*[$sentence_start])/$1\n$2/g;
        pattern_str = r'([?!.\u0964\u0965][ ]*[\u300d\u300f\'\"\)\]\p{Pf}]+) +([\'\"\(\[¿¡\p{Pi}]*[ ]*' \
                      + f'[{self.__sentence_start}])'
        content = regex.subf(pattern_str, '{1}\n{2}', content)

        # Add breaks for sentences that end with some sort of punctuation,
        # and are followed by a sentence starter punctuation and upper case.
        # $text =~ s/([?!\.\x{0964}\x{0965}]) +([\x{300d}\x{300f}\'\"\(\[\¿\¡\p{IsPi}]+[\ ]*[$sentence_start])/$1\n$2/g;
        pattern_str = r'([?!.\u0964\u0965]) +([\u300d\u300f\'\"\(\[¿¡\p{Pi}]+[ ]*' \
                      + f'[{self.__sentence_start}])'
        content = regex.subf(pattern_str, '{1}\n{2}', content)

        # NOTE: Korean no longer handled here, cos Korean has spaces.
        if 1 == self.__is_cjk:
            # Chinese uses unusual end-of-sentence markers. These are NOT
            # followed by whitespace.  Nor is there any idea of capitalization.
            # There does not appear to be any unicode category for full-stops
            # in general, so list them here.  U+3002 U+FF0E U+FF1F U+FF01
            # $text =~ s/([。．？！♪])/$1\n/g;
            # $text =~ s/([\x{3002}\x{ff0e}\x{FF1F}\x{FF01}]+\s*["\x{201d}\x{201e}\x{300d}\x{300f}]?\s*)/$1\n/g;
            pattern_str = r'([\u3002\uff0e\uFF1F\uFF01]+\s*[\"\u201d\u201e\u300d\u300f]?\s*)'
            content = regex.subf(pattern_str, '{1}\n', content)
            # A normal full-stop or other Western sentence enders followed
            # by an ideograph is an end-of-sentence, always.
            # $text =~ s/([\.?!]) *(\p{CJK})/$1\n$2/g;
            pattern_str = r'([.?!]) *(\p{CJK})'
            content = regex.subf(pattern_str, '{1}\n{2}', content)
            # Split close-paren-then-comma into two.
            # $text =~ s/(\p{Punctuation}) *(\p{Punctuation})/ $1 $2 /g;
            pattern_str = r'([\p{Punctuation}]) *([\p{Punctuation}])'
            content = regex.subf(pattern_str, '{1} {2}', content)

        # Urdu support
        # https://en.wikipedia.org/wiki/Urdu_alphabet#Encoding_Urdu_in_Unicode
        if 'ur' == self.language:
            # $text = ~ s
            # {
            #     ((?:[\.\?!\x{06d4}] |  \.\.+)
            #     [\'\"\x{201e}\x{bb}\(\[\¿\¡\p{IsPf}]*
            #      )
            # \s +
            #  ([\'\"\x{201e}\x{bb}\(\[\¿\¡\p{IsPi}]*
            #  [\x{0600}-\x{06ff}]
            #  )
            # }{$1\n$2}gx;
            pattern_str = r'((?:[.?!\u06d4]| \.\.+)[\'\"\u201e\xbb\(\[¿¡\p{Pf}]*)\s+([\'\"\u201e\xbb}\(\[¿¡\p{Pi}]*[\u0600-\u06ff])'
            content = regex.subf(pattern_str, '{1}\n{2}', content)

        lines = regex.split('\h', content)
        content = ''
        length = len(lines)
        for i in range(length):
            line = lines[i]
            m = regex.match(r'([\p{Alnum}\.\-]*)([\'\"\)\]%\p{Pf}]*)(\.+)$', line)
            if m:
                prefix = m.group(1)
                starting_punct = m.group(2)
                if prefix and prefix in self.__prefix.keys() and self.__prefix[prefix] == 1 and not starting_punct:
                    # Not breaking
                    # print(f'NBP1:{lines[i]} {lines[i + 1 if i < length - 1 else i]}\n')
                    pass
                elif regex.match(r'(\.)[\p{Upper}\-]+(\.+)$', lines[i]):
                    # Not breaking - upper case acronym
                    # print(f'NBP2:{lines[i]} {lines[i + 1 if i < length - 1 else i]}\n')
                    pass
                elif list_item and (i == 0 or lines[i - 1].endswith('\n')) and regex.match(
                        r'^\(?(([0-9]+)|([ivx]+)|([A-Za-z]))\)?\.$'):
                    ## Maybe list item - non breaking
                    # print(f'NBP3:{lines[i]} {lines[i + 1 if i < length - 1 else i]}\n')
                    pass
                elif i < length - 1 and regex.match(
                        r'([ ]*[\'\"\(\[¿¡\p{Pi}]*[ ]*[0-9' + f'{self.__sentence_start}])',
                        lines[i + 1]):  # todo: must i <length -1
                    # The next word has a bunch of initial quotes, maybe a  space, then either upper case or a number
                    # print(f"MAYBE {lines[i]} {lines[i + 1 if i < length - 1 else i]}\n")
                    # $words[$i] = $words[$i]."\n" unless ($prefix && $NONBREAKING_PREFIX{$prefix} && $NONBREAKING_PREFIX{$prefix} == 2 && !$starting_punct && ($words[$i+1] =~ /^[0-9]+/));
                    if not (prefix and prefix in self.__prefix.keys() and self.__prefix[
                        prefix] == 2 and not starting_punct and regex.match(r'^[0-9]+', lines[i + 1])):
                        line = line + '\n'
            content = f'{content}{line} '
        content = re.sub(r' +', ' ', content)
        content = re.sub(r'\n ', '\n', content)
        content = re.sub(r' \n', '\n', content)
        content = content.strip()
        if not content.endswith('\n'):
            content += '\n'
        return content

    # 以分词思路尝试分句
    def split_mose_test(self, content):
        # 将常见标点、乱码等符号与词语分开
        content = regex.subf(r"([^\p{Alnum}\s\.'\`\,\-])", ' {1} ', content)
        # 逗号处理
        comma_separate_1 = r"([^{}])[,]".format(self.__isN), r"{1} , "  # 若逗号前面不是数字，则分离逗号，如 hello,120 -> hello , 120
        comma_separate_2 = r"[,]([^{}])".format(self.__isN), r" , {1}"  # 若逗号后面不是数字，则分离逗号，如 120, hello -> 120 , hello
        comma_separate_3 = r"([{}])[,]$".format(self.__isN), r"{1} , "  # 如果数字后匹配到结尾符，则分离逗号。 如120， -> 120 ,
        comma_separate_4 = r"^[,]([{}])".format(self.__isN), r" {1}, "  # 如果数字后匹配到结尾符，则分离逗号。 如120， -> 120 ,
        for pattern, format in [comma_separate_1, comma_separate_2, comma_separate_3, comma_separate_4]:
            content = regex.subf(pattern, format, content)

        # 句号处理
        # 1.连续多个点号的情况（省略号）.....
        # 2.一个单独的大写字母跟一个. (通常出现在人名中，如Aaron C. Courville)
        # 3.其他的多字母人名，地名、机构名等缩写。 （如Gov.表示政府，Mr.代表某某先生）
        # 4.其他带.的缩写。（如e.g.表示举例，i.e.表示换句话说，rev.表示revision）
        # 5.一些.后面跟数字的情况（如No. Nos.），这种情况与前面的区别是只有当这些词后面跟随数字时才不是句子的结束，如No.也可能做否定的意思。
        # 6.月份的缩写。（如Jan. 表示一月，Feb.表示2月
        def replace_multidots(text):
            # 处理情况1，对多个"."的情况作mask处理
            text = regex.subf(r"\.([\.]+)", r" DOTMULTI{1}", text)
            while regex.search(r"DOTMULTI\.", text):
                text = regex.subf(r"DOTMULTI\.([^\.])", r"DOTDOTMULTI {1}", text)
                text = regex.sub(r"DOTMULTI\.", "DOTDOTMULTI", text)
            return text

        content = replace_multidots(content)

        def handles_nonbreaking_prefixes(text):
            # 将文本拆分为标记以检查 "." 为结尾的部分是否符合拆分条件
            tokens = text.split()
            num_tokens = len(tokens)
            for i, token in enumerate(tokens):
                # 判断是否以"."结尾
                token_ends_with_period = regex.search(r"^(\S+)\.$", token)
                if token_ends_with_period:
                    prefix = token_ends_with_period.group(1)

                    # 处理情况2,3,4,6
                    if (("." in prefix and self.isanyalpha(prefix)) or
                            (prefix in self.__prefix.keys() and 1 == self.__prefix[prefix]) or
                            (i != num_tokens - 1 and tokens[i + 1] and self.islower(tokens[i + 1][0]))):
                        pass  # 不做拆分处理
                    # 处理情况 5
                    elif (
                            prefix in self.__prefix.keys() and 2 == self.__prefix[prefix]
                            and (i + 1) < num_tokens
                            and re.search(r"^[0-9]+", tokens[i + 1])
                    ):
                        pass  # 不做拆分处理
                    else:  # 不在1-6中，做拆分处理
                        tokens[i] = prefix + " ."
            return " ".join(tokens)  # Stitch the tokens back.

        content = handles_nonbreaking_prefixes(content)

        def restore_multidots(text):
            # 恢复对多个"."的mask
            while re.search(r"DOTDOTMULTI", text):
                text = re.sub(r"DOTDOTMULTI", r"DOTMULTI.", text)
            return re.sub(r"DOTMULTI", r".", text)

        content = restore_multidots(content)
        return content

    # 新强制分句方法
    def seglongen(self, en):
        def find_all_index(content, chars):
            ret = []
            for i, v in enumerate(content):
                if v in chars:
                    ret.append(i)
            return ret

        lines = en.split('\n')
        res = []
        for i in lines:
            if len(i) <= self.__advice_length:
                res.append(i)
            else:
                if self.__is_cjk:
                    indexs = find_all_index(i, ',，')
                else:
                    indexs = find_all_index(i, ',')
                start = 0
                tmp = list(i)
                for k, v in enumerate(indexs):
                    if v - start > self.__advice_length \
                            or (k < len(indexs) - 1 and indexs[k + 1] - v > self.__advice_length) \
                            or (k == len(indexs) - 1 and len(i) - v > self.__advice_length):
                        tmp[v] += '\n'
                        start = v + 1
                res.append(''.join(tmp))
        return '\n'.join(res).strip()

    # 原强制分句方法
    def seglongen2(self, en):
        ret = []
        enseg = en  # nltk.word_tokenize(en)
        if len(enseg) <= self.__advice_length:
            ret = [en]
        else:
            begin = end = 0
            for i, word in enumerate(enseg):
                if word == ',' or word == ';' or word == '.':
                    end = i
                    if i - begin > self.__advice_length:
                        tmp = enseg[begin:end + 1]
                        ret.append(''.join(tmp))
                        begin = end + 1

            if len(enseg) > begin + 1:
                ret.append(''.join(enseg[begin:len(enseg)]))

        return '\n'.join(ret).strip()

    # 超长文本强制拆分规则
    # 1. ；;表示语义停顿 可以当作另一句进行拆分
    # 2. 针对英文 “, [Aa]nd) that”|", [Aa]nd which"|", and also"|", and all"|", [Ww]hich"|", [Tt]hat" 用于引起从句的词，进行语句拆分
    # 3. 针对英文 “， [Upper]+?[Alnum]+?” 逗号后跟大写字母开头单词，进行分割
    def __split_force(self, content, seglongen):
        pattern_str = r'([;；])'
        content = regex.subf(pattern_str, '{1}\n', content)
        pattern_str = r'([,，]) *?((?:[Aa]nd [Tt]hat)|(?:[Aa]nd [Ww]hich)|(?:[Aa]nd also)|(?:[Aa]nd all)|(?:[Ww]hich)|(?:[Tt]hat)|(?:shall))'
        content = regex.subf(pattern_str, '{1}\n{2}', content)
        lines = content.split('\n')
        for i, v in enumerate(lines):
            if len(v) > self.__advice_length:
                en = v
                pattern_str = r'([,，]) *?([\p{Upper}]+?[\p{Alnum}]+?)'
                en = regex.subf(pattern_str, '{1}\n{2}', en)
                lines[i] = seglongen(en)
                pass
        content = '\n'.join(lines)
        return content

    # 根据建议长度，进行有限制的分词

    def split_mose_limit(self, content, func=None):
        seglongen = self.seglongen
        if func is not None:
            seglongen = func
        content = self.split_mose(content)
        lines = content.split('\n')
        for i, v in enumerate(lines):
            if len(v) >= self.__advice_length:
                lines[i] = self.__split_force(v, seglongen)
        return '\n'.join(lines)


if __name__ == '__main__':
    contents = []
    contents.append(
        'And for the more effectual encouragement of merchants that shall trade to those parts We have thought fit to erect and establish, and We do by these presents erect constitute and establish, a Court of Judicature to be held at such place or places fort or forts plantations or factories upon the said coasts as the said Company shall from time to time direct and appoint, which Court shall consist of one person learned in the Civil Laws and two merchants, Which said persons and such officers of the said Court as shall be thought necessary shall be nominated and appointed from time to time by the Court of Assistants or the major part of them, And which said person learned in the Civil Laws and two merchants or the major part of them, whereof the said personlearned in the Civil Laws to be one, shall have cognizance and power to hear and determine all cases of forfeiture and seizures of any ship or ships goods and merchandises trading and coming upon any the said coasts or limits contrary to the true intent of these presents, and also all causes of mercantile or maritime bargains buying selling and bartering of wares whatsoever and all policies or acts of assurance all bills bonds or promises for payment of money on mercantile or trading contracts all charter parties or contracts for affreighting of vessels and wages of mariners and all other mercantile and maritime cases whatsoever concerning any person or persons residing coming or being in the places aforesaid, and all cases of trespasses injuries and wrongs done or committed upon the high sea or in any of the regions territories countries or places aforesaid concerning any person or persons residing coming or being in the places aforesaid.')
    contents.append(
        'And that, notwithstanding sundry designs and attempts have heretofore been made and set on foot and very great sums of money raised for the carrying on of the said trade here in England, the same have hitherto failed and proved ineffectual until our dearest Brother James Duke of York and others the persons hereinafter named, being willing to promote so good a work, have for near three years past (mauger all the difficulties and discouragements they have met with) undertaken and managed the said fishing trade with some effect, Who, finding by experience that if they were incorporated they should be thereby much better enabled and capable to prosecute and carry on the same, have therefore humbly besought Us for their greater encouragement to incorporate them and all such others as they shall admit into their Society by the name of The Company of the Koyal Fishery of England, with such powers privileges and immunities as hereinafter are expressed,')
    contents.append(
        '[Constitution : one Governor, one Sub- Governor, one Deputy Governor and twelve Committees], Which said Governor Sub-Governor Deputy Governor and Committees We will shall be and shall be called the Court of Assistants of the Eoyal Fishery of England, and that they or any three or more of them, whereof the Governor or Sub-Governor or Deputy Governor to be always one, shall be and are hereby authorised and empowered according to such rules orders and directions as shall be from time to time made and given unto them by the General Court of the said Company [to manage affairs and servants , and generally to act as they shall judge necessary and expedient to the well ordering and government of the said Company and the improvement of their joint stock and trade, And to do enjoy perform and execute all the powers authorities privileges acts and things in like manner to all intents and purposes as if the same were done at and by a General Court of the said Company.')
    contents.append(
        'and to increase contract or divide their Joint Stock or any part thereof, when so often in such proportion and manner as they or the greatest part of them then present, whereof the Governor Sub-Governor or Deputy Governor of the said Company for the time being to be always one, shall think fit : Admitted persons must first take the oath above prescribed.')
    contents.append(
        "And our further will and pleasure is, and We do hereby for Us our heirs and successors declare and grant unto the said Company  and their successors, That all and every the masters skippers and steersmen of the several doggers busses and other fishing vessels of and belonging to the said Company and their ships' crews mariners fishermen and others who shall from time to time be employed by the said Company and their successors in and about their said fishery, as well foreigners as natives and subjects of this our said Kingdom of England, during such their respective employments shall not be empanelled summoned or sworn or compelled by any Sheriff Bailiff or other officer of Us our heirs or successors to serve on any juries or inquests at Westminster the Assizes or Sessions or elsewhere .")
    contents.append(
        'And further know ye that, for the greater encouragement and better enabling of the said Company effectually to prosecute and carry on the said fishing trade, of our more abundant grace certain knowledge and mere motion We have given and granted and hereby  do give unto the said Company the yearly sum of twenty pounds of lawful money of England for each and every respective dogger which they now have and are owners of or which within and during the time and space of seven years, to be accounted from the day of the date of these presents, they and their successors shall build or cause to be built in England or any other of our Dominions, To have hold receive perceive take and enjoy the said yearly sum of twenty pounds for each and every respective dogger which they now have  or shall build as above unto the said Company  and their successors, to the only proper use and behoof of the same Company and their successors for and during so much and so long time of the said seven years to be accounted as aforesaid as the same doggers shall respectively be employed in and about the said fishery and no longer, the same to be paid quarterly out of our Eevenue arising by the Customs within our Port of London by the hands of the Cashier or Eeceiver General of the Customs of Us our heirs and successors for the time being, at the four most usual Feasts or days of payment in the year that is to say at the Feasts of St Michaell the Archangel, the Birth of our Lord Christ, the Annunciation of the Blessed Virgin Mary and theNativity of St John Baptist by even and equal portions, the first quarterly payment of the said yearly sum of twenty pounds for each and every respective dogger which the said Company now have and are owners of, to begin and be made on such of the said Feast days which shall first and next happen after the date of these presents.')
    contents.append(
        '4.我们实现的高精度证明了该方法的有效性，并表明该方法已准备好用于生产中。通过使用更合适的照明条件和更好的镜片质量，可以进一步提高性能，从而在刀具和背景之间获得更高的对比度。通过适当的改进，可用于多种小型多齿类刀具，这种刀具通常有许多切削刃且以主后刀面磨损值判定磨损程度。')
    contents.append(
        'M.Castejo´n等人[2]对于车刀磨损的二值图使用几何描述符进行描述，通过LDA（线性判别分析）找出三个最主要的描述符。使用基于模型的聚类分析发现了三个磨损水平，并通过Fowlkes-Mallows指数进行了评估同时还提供了一种工具更换标准，以保持零件公差。J.Jurkovic[4]等人在刀具测量区域投射栅格激光，通过栅格间距和曲率来计算刀具磨损量VB与月牙洼深度。丝锥磨损检测方面，Gil Del Val A[5]通过对来自主轴电流信号的数据进行工业监控应用（SPC），以评估螺纹质量。Peter Monka[6]通过振动诊断来确定丝锥磨损，通过实验发现特定范围内的频率和丝锥磨损有关。这些间接测量容易受噪声影响，而且只能应用在特定加工条件。')
    contents.append(
        'Engineering - Marine Science and Engineering; Hiroshima University Researchers Focus on Marine Science and Engineering (Numerical Prediction of Welding Distortion Considering Gravity Force on General Ship Grillage Structure by Elastic Finite Element Method Using Inherent Strain)')
    contents.append(
        "Leaf senescence constitutes a highly regulated final phase of leaf development, leading to cell death that is recognized as a type of programmed cell death (PCD). Degradation of nuclear DNA into oligonucleosomal fragments (DNA ladder) and terminal deoxynucleotidyl transferase-mediated dUTP nick end labeling (TUNEL) assay are methods commonly used to detect PCD-specific DNA cleavage. TUNEL reaction in situ labels free 3'-OH DNA strand breaks (nicks), thus allowing histological localization of nuclear DNA degradation during PCD. Here we describe in situ labeling of PCD-specific nuclear DNA fragmentation on conventional histological sections of senescing tobacco leaves. Incorporation of fluorescein-labeled dUTPs is detected by fluorescence microscopy, which enables in situ visualization of PCD at the single-cell level in the leaf mesophyll tissues undergoing senescence.")
    contents.append(
        '针对目标检测与跟踪时辐射控制问题，提出一种面向协同检测与跟踪的多传感器长时调度方法.首先建立基于部分马尔可夫决策过程(POMDP)的目标跟踪与辐射控制模型;然后以随机分布粒子计算新生目标检测概率,以后验克拉美-罗下界(PCRLB)预测长时跟踪精度,以隐马尔可夫模型(HMM)滤波器推导长时辐射代价;最后构建新生目标检测概率和已有目标跟踪精度约束下辐射控制的长时优化函数,给出基于贪婪搜索的分支定界算法求解最优调度序列.仿真结果验证了所提出方法的有效性.')
    contents.append(
        'In this paper, an endophytic strain B-001 against tobacco bacterial wilt (Ralstonia solanacarum) was isolated from the stem of healthy tobacco in R. solanacarum-infected fields, which had a stronger inhibitory effect on some kinds of gram-positive bacteria, gram-negative bacteria, and pathogenic fungi. This strain belonged to Bacillus, and its 16S rDNA after PCR and sequencing had an accession of GenBank being DQ444283. The 16S rDNA phylogenetic tree was constructed with MEGA3, and compared with the published 16S rDNA sequences of relative bacteria species. B-001 had a 99.2% sequence similarity with Bacillus subtilis (DQ415893). According to the morphological, physiological and biochemical characteristics, and based on phylogenetic analysis, B-001 was identified as a strain of B. subtilis. Field experiments in Guiyang and Ningxiang counties of Hunan Province showed that in 2005 and 2006, the control efficacy of B-001 on R. solanacarum ranged from 40.03% to 78. 14%, better than that of Streptomycini.')
    contents.append(
        'Concurrent use of electronic cigarettes (ent use of electronic cigarettes (e-cigarettes) as an alternative source of nicotine may lead to lower smoke exposure, tobacco addiction and reinforcing value of conventional combustible cigarettes. In two different cohorts, we characterized smokers, dual cigarette/e-cigarette users, and e-cigarette-only users in terms of sociodemographic, motives and patterns of e-cigarette use. Differences in smoking-related characteristics and reinforcing value of cigarettes between smokers and e-cigarette dual users were also examined. Two cohorts comprising 339 community adults [Sample 1; aged 18–65] and 293 young adult binge drinkers [Sample 2; aged 19–24] were recruited in Hamilton, Ontario. All participants provided expired carbon monoxide (CO) samples and completed an assessment battery including the Fagerström Test of Nicotine Dependence (FTND), the Wisconsin Inventory of Smoking Dependence Motives (WISDM), and the Cigarette Purchase Task (CPT). In both samples, smoking rate, CO level, FTND, WISDM, and CPT responses did not significantly differ between smokers and dual users. Compared to e-cigarette-only individuals, dual users from the two cohorts reported a greater use of e-cigarettes for quitting smoking, but dual product consumers exhibited no significant differences in motivation for change relative to combustible-only smokers. Relative to smokers, e-cigarette dual users did not show lower levels of smoking, lower severity of cigarette addiction and reinforcing value of cigarettes in these samples. These findings suggest that concurrent e-cigarette use does not affect combustible tobacco use or motivation, or reduce its harms.')
    contents.append(
        '针对敏捷凝视卫星密集点目标观测规划问题,提出一种快速观测任务聚类策略和启发式蚁群优化算法.首先,针对敏捷凝视卫星视场范围特点,提出基于顶点度的团划分算法,解决密集点观测任务聚类问题,形成系列团观测目标,有效提高观测效率;其次,为得到最优团目标观测序列,考虑目标可见时间窗口约束以及卫星敏捷机动能力约束,构建基于多目标观测收益和姿态机动能耗的性能指标,实现能量高效的任务规划;再次,为克服传统蚁群算法易陷入局部极小值和收敛较慢的缺点,设计一种同时考虑目标点优先级、目标可见时间窗口、目标之间卫星姿态转换时间等因素的启发式蚁群算法;最后,选取大规模密集地面目标验证所提出算法的可行性和高效性.')
    contents.append(
        'The behavior of the ash-additive mixtures at  high temperatures can  be  gleaned from a  study of the  XRD.  XRD  patterns  obtained  from quenched ash  samples are  fairly complex.  Figures  5 and 6  show  the  principal  phases  observed  in  the  Plateau  B-CaO  and  Blair  Athol  B-CaO  mixtures, respectively.  They  were  kept  in  the  furnace  for  300 s.  At  1073 K,  quartz  and  anorthite were  the principal phases  present with a  small amount of pseudowollastonite (CaO.SiO2).  With increasing temperature  quartz  and  calcite  added  as  an  additive  decreased,  and  mullite,  anorthite  and pseudo-wollastonite increased.  Gehlenite and alite (3CaO. SiO0 were the principal phase observed for calcium rich  mixtures.  Between  1273 and  1473 K  wustite reacts  with  quartz  and  anorthite  to yield  fayalite and  silica  melts.  Above  1473 K  all  the  iron  has  been  incorporated  into  a  viscous silicate  liquid.  The  major  minerals  identified coincide with  the  minerals in  the  phase  diagram  of SiO 2-A1203-CaO  [15]. Melting begins  significantly above a  temperature of 1538 K, which is almost equal to the lower eutectic points in the diagram, and incorporation of calcium into the glass phase is  normally completed  between  1573 and  1773 K.')
    contents.append(
        'Tamoxifen is an estrogen modulator widely used in the treatment of patients with ESR/ER-positive breast cancer; however, resistance limits its clinical application. Autophagy alterations have recently been suggested as a new mechanism for tamoxifen resistance. Glucose transporter 1 (GLUT1) has been reported to be associated with the development and metastasis of breast cancer, but the relationship among GLUT1, autophagy, and endocrine resistance remains unclear. Our present study found that GLUT1 expression and autophagy flux were upregulated in the tamoxifen-resistant breast cancer cell line MCF-7/TAMR-1 and that knockdown of GLUT1 promoted sensitization to tamoxifen. Moreover, knockdown of GLUT1 significantly decreased the enhancement of autophagy flux in tamoxifen-resistant cell lines. Furthermore, inhibiting autophagy in tamoxifen-resistant cells resulted in sensitization to tamoxifen. We conclude that GLUT1 contributes to tamoxifen resistance in breast cancer and that tamoxifen-resistant cells become resensitized to tamoxifen after GLUT1 silencing. These findings suggest GLUT1 as a new factor clinically associated with resistance to tamoxifen.')
    contents.append(
        'Mouse myoblast C2C12 cells are commonly used as a model system for investigating the metabolic regulation of skeletal muscle. As it is therefore important to understand the metabolic features of C2C12 cells, we examined the effect of glucose starvation on autophagy in C2C12 myotubes. After culture of C2C12 myotubes with high (HG, 25.0 mM) or low (LG, 5.6 mM) glucose concentrations, the concentration of glucose in the LG group had decreased to 0 mM after 24 h of culture and was around 17 mM after 48 h of culture in the HG group. The concentration of lactate increased from 0 to approximately 9 mM at 24 h and then dropped slightly in the LG group, while it increased linearly to 21 mM in the HG group at 48 h. The phosphorylation of p70 S6 kinase, marker for the protein translation initiation was significantly lower and the ratio of LC3-II/LC3-I, marker for the induction of autophagy was significantly higher in the LG group. GLUT1 and hexokinase II expression were significantly higher in the LG group. Together, these changes in glucose and lactate concentrations in the culture media suggest that C2C12 myotubes depend on anaerobic glycolysis. Our findings also suggest that glucose depletion stimulates the expression of key molecules involved in glycolysis and that cellular autophagy is also activated in C2C12 myotubes.')
    contents.append(
        'The Warburg effect is an important characteristic of tumor cells, making it an attractive therapeutic target. Current anticancer drug development strategies predominantly focus on inhibitors of the specific molecular effectors involved in tumor cell proliferation. These drugs or natural compounds, many of which target the Warburg effect and the underlying mechanisms, still need to be characterized. To elucidate the anticancer effects of a natural diterpenoid, oridonin, we first demonstrated the anticancer activity of oridonin both in vitro and in vivo in colorectal cancer (CRC) cells. Then miRNA profiling of SW480 cells revealed those intracellular signaling related to energy supply was affected by oridonin, suggesting that glucose metabolism is a potential target for CRC therapy. Moreover, our results indicated that oridonin induced metabolic imbalances by significantly inhibiting glucose uptake and reducing lactate export through significantly downregulating the protein levels of GLUT1 and MCT1 in vitro and vivo. However, the ATP level in oridonin-treated CRC cells was not decreased when oridonin blocked the glucose supply, indicating that oridonin induced autophagy process, an important ATP source in cancer cells. The observation was then supported by the results of LC3-II detection and transmission electron microscopy analysis, which confirmed the presence of autophagy. Furthermore, p-AMPK was rapidly deactivated following oridonin treatment, resulting in downregulation of GLUT1 and induction of autophagy in the cancer cells. Thus our finding helped to clarify the anticancer mechanisms of oridonin and suggested it could be applied as a glucose metabolism-targeting agent for cancer treatment.')
    contents.append(
        'Tumor metastasis is the primary factor causing death of cancer patients and it is a study emphasis in cancer treatment to suppress tumor metastasis by inhibiting glycolysis, which is the main way of energy supply for cell mobility in tumor. In the present study, we aimed to explore the effect of quercetin, a bioactive flavonoid, on tumor metastasis and cell glycolysis and its related functionary mechanism in breast cancer progression. Firstly, trans-well invasion assay and wound healing assay indicated that quercetin effectively suppressed cell mobility. The corresponding western blot revealed that quercetin treatment down-regulated the expression of cell migration marker proteins, such as matrix metalloproteinase 2 (MMP-2), MMP-9 and vascular endothelial growth factor (VEGF). The further experiments exhibited that quercetin successfully blocked cell glycolysis by inhibiting the level of glucose uptake and the production of lactic acid, and also decreased the level of glycolysis-related proteins Pyruvate kinase M2 (PKM2), Glucose transporter1(GLUT1) and Lactate dehydrogenase A (LDHA). The above results revealed that quercetin might inhibit glycolysis to limit the migration of tumor cells by reducing the acidity of the tumor microenvironment. Moreover, our further investigation showed that quercetin induced obvious autophagy via inactivating the Akt-mTOR pathway. At the same time, the application of autophagy inhibitor 3-MA and Akt-mTOR pathway inducer IGF-1 further demonstrated that quercetin exerted inhibiting effect on cell mobility and glycolysis through Akt-mTOR pathway mediated autophagy induction. At last, the in vivo experiments also showed that quercetin treatment could suppress tumor growth and metastasis, inhibit glycolysis and induce autophagy through the inhibition of p-AKT/AKT. Taken together, we firstly revealed that quercetin suppressed the progression of breast cancer by inhibiting cell mobility and glycolysis through Akt-mTOR pathway mediated autoph')
    contents.append(
        'Figure 5. Pharmacological inhibition of autophagy impairs shear-stress induced NO generation in human arterial endothelial cells Relative to static conditions, shear-stress increased Atg3 (A), LC3 II (B), GLUT1 (D), p-PKCδT505 (E) and p-eNOSS1177 (F) protein expression, NO generation (G), and p62 degradation (C) (bar 1 vs. 2). All responses were prevented by concurrent treatment with 3MA (bar 3 vs. 4). Images shown in the “merge” portion of H represent mean data shown in G. Calibration bar = 100 µm. For A–F, n=3, each n= 2 wells of a 6-well plate. For G and H, n=2, each n = 1 well of a 4 well chamber slide. *p<0.05 vs. (−shear)(− 3MA); # p<0.05 vs. (+shear)(− 3MA).')
    contents.append(
        'The DTA reveals both the exotherm associated with crystallization of the ash, and the endotherm associated with melting,  as deviations from  the base line.  In curves (a)  Figs 3 and  4, the TGA  and DTA  traces  of parent  coal  ashes,  Plateau  B  and  Blair  Athol  B,  in  the  reducing  atmosphere,  are shown.  The  characteristic  temperatures  are  also given in  these figures.  From  600-773 K  the  TGA curves  show  a  plateau  region.  At  about  800 K  the  decomposition  of pyrite  takes  place.  Between 1000  and  1200 K  there  is  a  weight  loss  due  to  the  decomposition  of calcite  and  the  TGA  curves levels  off;  no  further  weight-loss  reaction  takes  place.  It  was  not  possible  to  obtain  the corresponding  DTA  curves,  owing  to  the  small  endothermic  peak.')
    contents.append(
        'Figure  2  shows  the  typical  change  in  the  hemispherical  temperatures  with  CaO  addition.  The hemispherical  temperatures  of  the  ash-CaO  mixtures  gradually  decreased  with  increasing  CaO content  until  the CaO  content  reached  about  25-35 wt%,  and  the  hemispherical  temperature  then increased  at  higher  CaO  content  of  the  mixture.  The  minimum  values  of  the  hemispherical temperatures of the mixtures were in the range of 1373-1563 K and were 50--500 K  lower than those of parent  coal  ashes.  Melting  appears  to  be  accelerated  by the  presence  of iron  which  reacts  with quartz  to  yield  minerals  of  fayalite  (2FeO-SiO2),  and  causes  the  melting  temperatures  to  be somewhat  lowered  (see  Datong  A  and  Blair  Athol  A)[11].  Above  45 wt%  CaO  content  in  the mixtures,  the  hemispherical  temperatures  were  observed  to  be  beyond those  of the  parent  ashes, owing to  unreactive  CaO  residue which remained  on  the  sample board.  Empirical  rules have  been formulated  for  estimating  the  melting  range  of  ash-additives  on  the  basis  of  their  seven compositions [14].  The  fit  of some  ash-additive  mixtures  is  illustrated  in  Fig.  2.')
    contents.append(
        'This study has shown that 10 items from the full 32-item questionnaire largely predict the overall quality of life of our local ulcerative colitis patients (Table 1). There were two items that predicted 􏰐75% of the variance of the total IBDQ score: item number 12 (difficulty in leisure or sports, social domain) and item number 21 (believe relaxed and free of tension, emotional domain). It is also interesting to note that the bowel symptoms domain items (1 and 9) did not feature in the top five predictors. This highlights the importance of factors other than the physical having a major impact on the perception of quality of life by patients.')
    contents.append(
        'The IBDQ is a widely accepted disease-specific health- related quality-of-life measure, which has been well vali- dated in a number of different populations (4 – 6). It has been used for assessing the effectiveness of new treatments and in other epidemiological studies (7–12). The short form of the IBDQ (SIBDQ) was designed to be an easy and useable tool in the assessment of inflammatory bowel disease patients in the busy clinical setting. The original development and validation of the SIBDQ was done using the Crohn’s disease patients from the Canadian Crohn’s Relapse Prevention Trial (CCRPT) (1). There are no published data concerning its use in ulcerative colitis patients.')
    contents.append(
        'Coal ashes were pulverized to  below 74/zm in an agate mortar and were thoroughly mixed with a  basic  oxide,  CaCO3  (chemicals).  The  ash  melting  data  were  obtained  in  accordance with  the Japanese  Industrial  Standard  (JIS)  M8801  procedures.  Using  this  test,  the  three  characteristic temperatures,  i.e.  the  softening  temperature,  the  hemispherical  temperature  and  the  fluid temperature, were determined under the recommended reducing atmosphere of 60%  CO and 40% CO2. TGA  and  DTA were simultaneously carried out with a  Rigaku  Series  8823 thermal analysis system. The analyzer has  a  cell assembly containing two matched A1203 crucibles. One crucible is filled with a  reference material, usually A1203, and the other with the sample. The operating range was  473-1873  K  (10 K  min -~)  under  the  reducing atmosphere.  The  ash  melting apparatus  which was modified to allow rapid heating and quenching of ash-additive samples is shown in Fig.  1. The sample was dropped in the furnace and  reacted for  10-300  s at desired temperatures ranging from 1073 to  1773 K,  and then was quenched into  water. Total  quenching time was normally  ~  5-10 s. Quenched samples  were examined by  XRD  and  FT-IR  methods  of analysis.  XRD  analysis was utilized to  evaluate the phases present in the high temperature residues. The degree of disorder in the  melted  glass  phase  containing  CaO,  shown  by  the  infrared  spectrum  of  the  v3  stretching vibration  of the  Si-O  bond,  was  measured  by  FT-IR  analysis.  Three  characteristic temperatures of coal ash  studied in this work are given in Table  1. The chemical compositions of ash prepared')
    contents.append(
        'Some  studies  have  been  carried  out  on  the  high-temperature  transformations  and  reactions undergone by the mineral derived phases,  and  the relation between ash  melting temperatures and the chemical composition of coal ash [1-7].  Huggins et  al.  [8] investigated the relationship between the melting temperatures of ash-Fe203,  CaO  or K2CO3 mixtures and the SiO2-AI203-XO (X =  Fe, Ca  or  K2)  phase  diagram.  Nitta  et  al.  [9]  reported  that  the  melting  temperature  of  an ash-Fe203 mixture was dependent on the alkali, alkali earth metal and iron content. However, the effects of the additives on ash melting and  slag viscosity have barely been explored in detail from the view of control of ash melting and  slag fluidity in the gasifier.  Recent work has demonstrated the  effects  of  CaCO3  and  Fe203  chemicals,  limestone,  iron  ore  and  red  mud  on  ash  melting for  several  ashes,  under  both  oxidizing  and  reducing  atmospheres [10-12].  The  second-order regression  equation  for  calculating  hemispherical  temperatures  of  ash-additive  mixtures  was  proposed  as  a  function  of normalized chemical composition  of SiO2, A1203, CaO  and  FeO [13]. The  trend  for  a  decrease  in  melting  temperatures  with  the  additive  was  acknowledged  under reducing atmospheres and  the suitable addition of the additive was in the range of 25-40 wt%  for the  ashes  employed.')
    contents.append(
        'The reliability of the 5 MFI-20 subscales (general fatigue, physical fatigue, reduced activity, reduced motivation, and mental fatigue) is satisfying. The correlations between MFI-20 subscales and the fatigue scale of the quality-of-life questionnaire EORTC indicate convergent validity. As an important result we found that all subscales of the MFI-20 showed a clear and nearly linear dependency on age with higher fatigue values for older subjects (p < 0.0001). Females as compared with males are characterized by higher mean values in all MFI-20 subscales (p < 0.001).')
    contents.append(
        'Minerals in  coal  have  been  studied in  some detail,  but  little  work has  been done  on  mineral and liquid  phases  formed  from  these  minerals  when  coal  is  gasified  at  high  temperatures.  During the  high-temperature  gasification  process,  the  extreme  temperature  rise  can  either  transform or  recombine  the  mineral  matter  in  coal  to  form  new  phases.  The  new  mineral  phases  can melt  and  become  a  liquid  or  liquid-solid  mixture,  which  may  be  withdrawn  at  the  bottom  of the  gasifier  without  promoting  corrosion  in  the  reactor  insulation.  Efficient  gasification  of  a particular  coal  depends,  sensitively,  on  the  melting  behavior  of  the  ash  produced  from  that coal  and  the  flow  properties  of  the  molten  slag.  It  is  also  important  to  control  high  melting temperature ash by adding basic oxides which cause a  decrease in the ash melting temperature and slag  viscosity.')
    contents.append(
        'The  results  of  the  study  show  that  the  CaCO3  additive  is  an  efficient  fluxing  element  for  the control  of  ash  melting,  more  particularly  A12Orrich  ash  melting.  The  minimum  values  of  the hemispherical  temperatures  of the ash-additive mixtures were 50-500 K  lower than  those of parent coal  ashes.  Empirical  equations  have  been  derived  to  relate  ash  fusion  temperatures  to  ash composition.  In most  cases the  predicted  Tnr  values were within  50 K  of the  experimental  values. In  the  TGA-DTA  study  of some  ash-additive  mixtures,  it  can  be  seen  that  the  mixtures  do  not melt  sharply  and  completely  at  a  given  temperature,  and,  in  most  instances,  an  interval  of   temperature between the onset of sintering and completion decreased with increasing the additive. X-ray diffraction studies of the mixtures at elevated temperature (up to  1773 K) shed some light on  the  phase transformations  that  the  mineral  systems undergo.  Interaction  between the components of  the  coal ashes and  the  additive proceeds with the  system SiO2-Al2OrCaO. A  knowledge  o f the  original  mineralogical  c o m p o s i t i o n  can  be  o f assistance  in  interpreting  b o t h  the high  temperature  phases  f o r m e d  a n d  the  ash  melting  behavior.  F r o m  the  F T - I R  data,  melted  glass phase  c o n t a i n i n g  C a O  was  depolymerized  relative  t o  the  p a r e n t  coal  glass  a n d  has  higher pozzolanic  reactivity  (supplementary  cementing  material).')
    contents.append(
        'Scores of all dimensions of the IBDQ and SF-36 were significantly worse in both CD and UC patients with active disease compared to those with quiescent state. There were no IBDU patients having active disease. In CD as well as in UC patients with anemia, the MFI-20 was sig- nificantly worse for physical fatigue and reduced activity than in patients without anemia. In anemic UC patients, scores were also significantly worse on the dimension gen- eral fatigue (P < 0.0005); in anemic IBDU patients, only physical fatigue scored significantly worse (P < 0.05). In CD, anemia was also associated with a significantly worse score on the IBDQ dimension social functioning (P < 0.05) and the SF-36 dimensions; role of limitations due to physical health problems, bodily pain (data not shown), and physical health (P < 0.05). In anemic UC patients, all IBDQ dimensions scored significantly worse than in nona- nemic, as were the SF-36 dimensions physical functioning; role of limitations due to physical health problems; bodily pain; general health perception; vitality; social function (data not shown); and the computed dimension physical health (P < 0.005). In anemic IBDU patients, IBDQ and SF-36 dimensions were not significantly different from nonanemic, probably due to the small number of patients.')
    contents.append(
        'In Table 2, mean MFI-20, IBDQ, SF-36, HADS-A, and HADS-D scores per diagnosis are presented. Data are presented overall and according to disease activity and presence of anemia. Overall scores of the MFI-20 dimen- sions ‘‘general fatigue’’ and ‘‘physical fatigue’’ were signifi- cantly worse in CD compared to UC and IBDU (P < 0.0005). All IBDQ dimensions and the computed physical health dimension of the SF-36 score was also significantly worse in CD patients (P < 0.005). Of the SF-36 the dimen- sions physical functioning; role of limitations due to physi- cal health problems; bodily pain; general health perception; vitality; and social function were significantly worse in CD compared to UC (data not shown). In CD, all MFI-20 dimensions scored significantly worse in patients with active disease. For UC, this was similar for general fatigue, physical fatigue, and reduced activity but not for reduced motivation and mental fatigue.')
    contents.append(
        'Abstract--The  results  of this  study  show  that  CaCO3  additives  are  an  efficient  fluxing  element  for  the control of ash melting, more particularly A12O 3-rich ash melting.  The minimum values of the hemispherical temperatures of the ash-additive mixtures were 50-500 K  lower than those of parent coal ashes.  Empirical equations have been derived to relate ash fusion temperatures to ash composition. X-ray diffraction studies of the mixtures at  elevated temperature  (up  to  1773 K)  showed  some light on  the phase  transformations that  the mineral systems  undergo.  Interaction between the components of the coal ashes  and  the additive proceeds within the system  SiO2-AI203-CaO. A  knowledge of the original mineralogical composition can be  of assistance  in  interpreting both  the high  temperature  phases  formed  and  the  ash  melting behavior. From FT-IR data,  melted glass phase containing CaD was depolymerized relative to the parent coal glass and  had  a  higher pozzolanic reactivity (supplementary cementing material).  ©  1997 Elsevier Science  Ltd.')
    contents.append(
        'Figure 11 depicts the residues of Coal B. The highest gas-ifier temperature during the experiment was around 1,600 K, lower  than  the  ash  fusion  temperature.  Larger  residue  was found  in  the  bottom  section  and  the  particle  surface  ap-peared to diﬀer from that of Coal A residue. Fine spherical molten ash particles, as seen in Figure 11(b), were also ob-served  in  the  bottom  residue.  Spherical  particles  were  not stuck  together,  but  separate.  Considering  both  the  appear-ance  and  particle  size  distribution,  big  particles  collected from  the  bottom  seem  to  be  formed  by  agglomeration  and swelling  of  char.  Agglomeration  might  result  from  melting of the char and ash, thus making the particles hard enough to  endure  microwave  irradiation.  Residue  in  the  cyclone may be an aggregate of char and ash, while finer residue ob-tained at the bag filter might consist of ash and soot.')
    contents.append(
        'orresponding to ash and char.SEM  micrographs  were  used  to  compare  the  appear-ances of the collected residues (see Figures 10 and 11). The same  magnification  ratio  was  used  for  all  samples.  Figure 10  depicts  the  residues  of  Coal  A.  The  highest  gasification temperature  was  around  1,650 K,  higher  than  the  ash  fu-sion temperature. Because feedstock was crushed and sieved before use, the fracture faces were sharp, but became round after gasification. Residue particles found at the bottom and cyclone  were  bigger  than  feedstock,  but  no  particles  were >100 µm (see Figure 9). The bottom residue from Coal A was aggregates of char and ash, and may be fragile because the  residue  was  broken  down  into  small  particles  by  ultra-sonic  irradiation.  The  residue  collected  from  the  bag  filter was an aggregate of fine particles.')
    zh = SplitHandler(language='zh', advice_length=200)
    # res = zh.split_mose_test(content)
    import time

    for content in contents:
        print(len(content))
        ts = time.time()
        res = zh.split_mose_limit(content).strip().split('\n')
        te = time.time()
        for i in res:
            print(len(i), i)
        result1 = [len(i) for i in res]
        result1.append(te - ts)
        print()
        ts = time.time()
        res = zh.split_mose_limit(content, func=zh.seglongen2).strip().split('\n')
        te = time.time()
        for i in res:
            print(len(i), i)
        result2 = [len(i) for i in res]
        result2.append(te - ts)

        print(result1)
        print(result2)
        print()
    pass
